﻿/*
* SceneManager.cpp
*
* 场景管理
*
* create date: 2014.4.10
* create by: leo
*
*/

#include "SceneManager.h"

#include "BattleScene.h"

USING_NS_CC;

bool CSceneManager::TransferToScene(int scene)
{
	CBaseScene* newScene = CSceneBuilder::CreateScene(scene);

	if (NULL != newScene)
	{
		switch (scene)
		{
			case SPLASH_SCENE:

				CCDirector::sharedDirector()->runWithScene(newScene);
				return true;

			case BATTLE_SCENE:
			{
				CBattleScene* battleScene = (CBattleScene*)newScene;
				battleScene->startBattle();
			}
				break;

			default:
				break;
		}

		CCDirector::sharedDirector()->replaceScene(newScene);
		return true;
	}

	return false;
}
